# Created by: Dryice Liu <dryice@dryice.name>
# $FreeBSD: head/devel/py-babel/Makefile 300896 2012-07-14 13:54:48Z beat $
#

PORTNAME=	Babel
PORTVERSION=	1.3
CATEGORIES=	devel python
MASTER_SITES=	CHEESESHOP
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
PKGNAMESUFFIX?=

MAINTAINER=	wen@FreeBSD.org
COMMENT=	Collection of tools for internationalizing Python applications

RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pytz>=2013:${PORTSDIR}/devel/py-pytz

USE_PYTHON=		yes
.if empty(PKGNAMESUFFIX)
USE_PYDISTUTILS=	easy_install
.endif

.include <bsd.port.pre.mk>

.if ${PKGNAMESUFFIX} == "-doc"
BUILD_DEPENDS=	${PKGNAMEPREFIX}sphinx>=1.1.3:${PORTSDIR}/textproc/py-sphinx

post-patch:
	@cd ${WRKSRC}/docs \
		&& ${REINPLACE_CMD} -e 's|%%PORTVERSION%%|${PORTVERSION}|g' \
		${WRKSRC}/docs/conf.py

do-build:
	@cd ${WRKSRC}/docs && ${MAKE} singlehtml

do-install:
	@${MKDIR} ${DOCSDIR}
	@cd ${WRKSRC}/docs/_build/singlehtml && ${COPYTREE_SHARE} . ${DOCSDIR}

post-install:
	@${RM} ${DOCSDIR}/objects.inv
.endif

.if ${PYTHON_REL} >= 320
.include "${PORTSDIR}/devel/py-virtualenv/files/py3k-fix-pkg-plist.inc"
.endif

.include <bsd.port.post.mk>
